//
//  HistoricVariableBase.m
//  LogAnything
//
//  Created by Daniel Braun on 22/06/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "HistoricVariableBase.h"


@implementation HistoEntryBase

- (id) init {
	self = [super init];
	if (self != nil) {
		//<#initializations#>
	}
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	//[super encodeWithCoder:coder];
	if ( [coder allowsKeyedCoding] ) {
		[coder encodeObject:date forKey:@"date"];
	}
}

- (id) initWithCoder:(NSCoder *) coder
{
	//self=[super initWithCoder:coder];
	self=[self init];
	if ([coder allowsKeyedCoding]) {
		date=[[coder decodeObjectForKey:@"date"]retain];
		return self;
	}
failed:
	[self release];
	return nil;
}

- initWithDate:(NSDate *)d
{
	self = [self init];
	if (self != nil) {
		date=[d retain];
	}
	return self;
}
- (NSComparisonResult)dateCompare:(HistoEntryBase *)anEntry
{
	return [date compare:anEntry->date];
}
@end


@implementation HistoricVariableBase

- (void) dealloc {
	[super dealloc];
}

- (id) init {
	self = [super init];
	if (self != nil) {
		comparator = @selector(dateCompare:);
	}
	return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
	[super encodeWithCoder:coder];
	if ( [coder allowsKeyedCoding] ) {
		//[coder encodeObject:historic forKey:@"historic"];
	}
}

- (id) initWithCoder:(NSCoder *) coder
{
	self=[super initWithCoder:coder];
	if (self && [coder allowsKeyedCoding]) {
		//
		return self;
	}
failed:
		[self release];
	return nil;
}

@end
